<HTML><HEAD><TITLE>denominator(+Number, -Result)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>denominator(+Number, -Result)</H1>
Extracts the denominator of the rational Number and unifies the resulting
integer with Result.


<DL>
<DT><EM>Number</EM></DT>
<DD>An integer or rational number.
</DD>
<DT><EM>Result</EM></DT>
<DD>A variable or integer.
</DD>
</DL>
<H2>Description</H2>
   This predicate is used by the ECLiPSe compiler to expand evaluable
   arithmetic expressions.  So the call to denominator(Number, Result) is
   equivalent to
<PRE>
    Result is denominator(Number)
</PRE>
    which should be preferred.
<P>
   In coroutining mode, if Number is uninstantiated, the call to
   denominator/2 is delayed until this variable is instantiated.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>denominator(+, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number is not instantiated (non-coroutining mode only).
<DT><EM>(5) type error </EM>
<DD>Number is a float or breal.
<DT><EM>(24) number expected </EM>
<DD>Number is not of a numeric type.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      denominator(3_4, 4).
      denominator(9_12, 4).
      denominator(-3_4, 4).
      denominator(25, 1).
Fail:
      denominator(3_4, 3).
      denominator(3.1, 3).
      denominator(3_4, 3_1).
      denominator(3_4, r).
Error:
      denominator(A, 3).                     (Error 4).
      denominator(1_3 + 3_4, 12).            (Error 24).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>, <A HREF="../../kernel/arithmetic/numerator-2.html">numerator / 2</A>, <A HREF="../../kernel/arithmetic/rational-2.html">rational / 2</A>
</BODY></HTML>
